import request from '@/utils/request'

export function listStudent(query) {
  return request({
    url: '/jiaxiao/student/list',
    method: 'get',
    params: query
  })
}

export function getStudent(studentId) {
  return request({
    url: '/jiaxiao/student/' + studentId,
    method: 'get'
  })
}

export function addStudent(data) {
  return request({
    url: '/jiaxiao/student',
    method: 'post',
    data: data
  })
}

export function updateStudent(data) {
  return request({
    url: '/jiaxiao/student',
    method: 'put',
    data: data
  })
}

export function delStudent(studentId) {
  return request({
    url: '/jiaxiao/student/' + studentId,
    method: 'delete'
  })
}

export function changeStudentStatus(studentId, toStatus, remark) {
  return request({
    url: `/jiaxiao/student/changeStatus/${studentId}`,
    method: 'put',
    params: { toStatus, remark }
  })
}

export function exportStudent(query) {
  return request({
    url: '/jiaxiao/student/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

export function importTemplate() {
  return request({
    url: '/jiaxiao/student/importTemplate',
    method: 'post',
    responseType: 'blob'
  })
}


